<script lang="ts" setup>
export interface ToolBarProps {
  list?: any
  all?: boolean // 是否显示全部
  moreValue?: boolean // 是否显示key, value
}

const props = withDefaults(defineProps<ToolBarProps>(), {
  list: [],
  all: true,
  moreValue: false,
})
const { list } = toRefs(props)
const emit = defineEmits(['onChange'])
const handleChange = (v: any) => {
  emit('onChange', v)
}
</script>
<template>
  <el-select :style="{ width: '155px' }" v-bind="$attrs" @change="handleChange" default-first-option value-key="modelid" placeholder="请选择栏目">
    <el-option v-if="all" :value="0" label="全部" />
    <el-option v-for="item in list" :key="item.modelid" :value="item" :label="item.model" />
  </el-select>
</template>
<style lang="scss"></style>
